package com.csk.zsk.compents.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import com.csk.zsk.commons.dao.impl.BaseHibernateDao;
import com.csk.zsk.compents.dao.BookChaptersDao;
import com.csk.zsk.compents.entity.BookChapters;

@Repository
public class BookChaptersDaoImpl extends BaseHibernateDao<BookChapters, String> implements BookChaptersDao {

	

	@Override
	public List<BookChapters> searchBookChaptersByBookId(String id) {
		List<BookChapters> list = this.createQuery("select new BookChapters(id,name,num,book) from BookChapters bookChapters where bookChapters.book.id='"+id+"' order by bookChapters.num").list();
		
		return list;
	}

	

}
